package com.mikelouis.test.scala.proginscala.chapter14

import org.testng.annotations.Test
import org.testng.Assert.assertEquals

/**
 * Created by yuazhu on 1/18/2015.
 */
class Element2TestNgTestSuite1 {
  @Test
  def verifyUnifromElement(): Unit = {
    val ele = Element2.elem('x', 2, 3)
    assertEquals(ele.width, 2)
    assertEquals(ele.height, 3)
  }

  @Test(expectedExceptions = Array(classOf[IllegalArgumentException]))
  def elementShouldThrowIAE(): Unit = {
    Element2.elem('x', -2, 3)
    throw new IllegalArgumentException("manually throw IllegalArgumentException")
  }

}
